FFA Cup: Perth Glory have narrowly avoided upset in their round of 16 clash against Lions FC, scoring a late winner in extra time at Perry Park.